<?php
if (!defined('APP_PATH')) {
	define('APP_PATH', $_SERVER['DOCUMENT_ROOT']."/bdACPA");
}
require_once(APP_PATH.'/required.php');
// require('../setup.inc.php');
// include('../auth.php');

//set content type and xml tag
header("Content-type:text/xml");
echo("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");

$out = "";
$out .=  "<items>";

$out .= "<item type='radio' name='typeSeparateur' labelWidth='auto' value='et' position='label-right' label='ET : Les patients auront obligatoirement tous les items cochés (et éventuellement d autre)' checked='true'/>";
$out .= "<item type='radio' name='typeSeparateur' labelWidth='auto' value='ou' position='label-right' label='OU : Les patients auront au moins l un des items cochés' checked='false'/>";
$out .= "	<item type='block' width='1200' >";
$phenotypePeres = $PHENOTYPEPERE_DAO->rechercher_phenotype_pere();
$i=0;
foreach ( $phenotypePeres as $phenotypePere){
	$out .= "	<item type='fieldset'  width='350' label='".$phenotypePere->libelle."' >";
	$phenotypes = $PHENOTYPE_DAO->rechercher_phenoByPere($phenotypePere->idphenotypepere);
	foreach ( $phenotypes as $phenotype)
	{
		if (substr($phenotype->idHPO, 0, 5) !="autre"){
		$out .="<item type='checkbox' position='label-right' label='".remove_carspeciaux($phenotype->libelle)."' name='pheno_".$phenotype->idphenotype."' value='1'  />";
		}
	}
	$out .= "		</item>";
	if ( $i == 4 || $i == 8){
		$out .= "		<item type='newcolumn' offset='50'/>";
	}
	$i++;
}
 $out .= "		</item>";


$out .= "			<item type='input' name='requete' inputWidth='1000' label='Requête' tooltip='' value='' readonly='1' rows='4'/>";
$out .= "			<item type='button' className='bouton' name='envoyer' value='Ok'  command='ok'/>";
$out .= "			<item type='button' className='bouton' name='annuler' value='Annuler' command='annuler'/>";
$out .= "</items>";
print($out);
?>